Skip to content

Update the data layout.#311

Merged
LegNeato merged 1 commit intoRust-GPU:mainfrom
nnethercote:update-data-layout
Nov 20, 2025
Merged

Update the data layout.#311
LegNeato merged 1 commit intoRust-GPU:mainfrom
nnethercote:update-data-layout

Conversation

@nnethercote
Copy link
Copy Markdown
Collaborator

Recent NVVM IR docs (e.g.
https://docs.nvidia.com/cuda/archive/13.0.0/nvvm-ir-spec/index.html#data-layout) mention four data layouts, which I will abbreviate as:

  • 64-bit-with-128-bit-integers
  • 32-bit-with-128-bit-integers
  • 64-bit-without-128-bit-integers
  • 32-bit-without-128-bit-integers

These docs have said the same thing for every CUDA version from 12.0 to 13.0:

  • 64-bit-with-128-bit-integers is "supported".
  • The others are "deprecated and will be removed in a future release".

We currently use 64-bit-without-128-bit integers. This works fine on CUDA 12.8, but doesn't work on CUDA 13.0 -- libNVVM spits out "DataLayoutError: Unsupported integer alignment". Even though the docs haven't changed, 13.0 seems to be the first version actually enforcing the deprecation. (Or maybe "deprecated" has become "removed" and the docs haven't caught up, given that there's no apparent way to avoid the error.)

This commit changes our data layout from 64-bit-without-128-bit-integers to 64-bit-with-128-bit-integers. This lets commands like cargo run -p compiletests -- --target-arch compute_75 run successfully on my ASUS GX10 with CUDA 13.0. There appear to be no ill side-effects.

Recent NVVM IR docs (e.g.
https://docs.nvidia.com/cuda/archive/13.0.0/nvvm-ir-spec/index.html#data-layout)
mention four data layouts, which I will abbreviate as:
- 64-bit-with-128-bit-integers
- 32-bit-with-128-bit-integers
- 64-bit-without-128-bit-integers
- 32-bit-without-128-bit-integers

These docs have said the same thing for every CUDA version from 12.0 to 13.0:
- 64-bit-with-128-bit-integers is "supported".
- The others are "deprecated and will be removed in a future release".

We currently use 64-bit-without-128-bit integers. This works fine on
CUDA 12.8, but doesn't work on CUDA 13.0 -- libNVVM spits out
"DataLayoutError: Unsupported integer alignment". Even though the docs
haven't changed, 13.0 seems to be the first version actually enforcing
the deprecation. (Or maybe "deprecated" has become "removed" and the
docs haven't caught up, given that there's no apparent way to avoid the
error.)

This commit changes our data layout from 64-bit-without-128-bit-integers
to 64-bit-with-128-bit-integers. This lets commands like `cargo run -p
compiletests -- --target-arch compute_75` run successfully on my ASUS
GX10 with CUDA 13.0. There appear to be no ill side-effects.
@LegNeato
Copy link
Copy Markdown
Contributor

Interesting, I guess they polyfill in software for older hardware without i128 support 🤔

@nnethercote nnethercote mentioned this pull request Nov 20, 2025
@LegNeato LegNeato merged commit aea98ad into Rust-GPU:main Nov 20, 2025
5 of 8 checks passed
@nnethercote nnethercote deleted the update-data-layout branch November 20, 2025 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants